package edu.chen.dao;


import edu.chen.bean.Product;

import java.util.List;

public interface ProductDao {
    /**
     * add a new Product instance
     * @param product
     */
    int insert(Product product);

    /**
     * delete a Product instance by id
     * @param id
     */
    int delete(int id);


    /**
     * delete Product Instance by productName return the number of deletions
     * @param name
     * @return
     */
    int delete(String name);

    /**
     * Query Product by id
     * @param id
     * @return
     */
    Product query(int id);

    /**
     * Query Product by name,
     * return a List for products
     * @param name
     * @return
     */
    List<Product> query(String name);

}
